<?php

namespace app\controller\wmapi;

use app\model\WaMenu;
use Illuminate\Support\Facades;
use Illuminate\Support\Facades\Validator;
use plugin\admin\app\common\Util;
use plugin\admin\app\model\Admin;
use support\Request;
use app\model\WaAdmins;
use app\model\WaRoles;
use app\model\WaRules;
use app\model\WaDepartment;
use Illuminate\Support\Facades\DB;
use Tymon\JWTAuth\Facades\JWTAuth;
use Illuminate\Support\Facades\Cache;
use Tinywan\Validate\Validate;

class PermissionController extends Validate
{
    /**
     * 菜单管理
     * @param Request $request
     * @return mixed
     */
    public function menu(Request $request)
    {
        process($request);
        $param = $request->all();
        $fields = ['*'];
        $condition = [];
        $condition [] = ['pid', '=', 0];
        $condition [] = ['hidden', '=', 'false'];
        $menu = WaMenu::all($fields,$condition);
        return IndexController::successed($menu, '菜单列表');
    }
}